package model.framework;

public class Block implements Cloneable{

	private BlockType blockType;
	private int id;
	private int x;
	private int y;
	private int rotation;

	public Block( BlockType blockType, int id) {
		this.blockType = blockType;
		this.id = id;
	}

	public int getId() {
		return id;
	}

	public void setId( int id ) {
		this.id = id;
	}

	public int getX() {
		return x;
	}

	public void setX( int x ) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY( int y ) {
		this.y = y;
	}

	public int getRotation() {
		return rotation;
	}

	public void setRotation( int rotation ) {
		this.rotation = rotation;
	}
	
	public BlockType getBlockType() {
		return blockType;
	}

	public int getHeight() {
		return blockType.getHeight(rotation);
	}
	
	public int getHeight( int rotation ) {
		return blockType.getHeight(rotation);
	}
	
	public int getWidth() {
		return blockType.getWidth(rotation);
	}

	public int getRotations() {
		return blockType.getRotations();
	}

	public int[] getSurface(int rotation) {
		return blockType.getSurface(rotation);
	}

	public int[][] getDescription() {
		return blockType.getDescription(rotation);
	}
	
	public Block clone(){
		Block result = new Block(blockType, id);
		result.x = this.x;
		result.y = this.y;
		result.rotation = this.rotation;
		return result;
	}
}
